This invention relates to an apparatus and method for data decoding, for inputting multiplexed coded data containing two or more coded data, and synchronizing outputs of decoded data based on the time information included in the multiplexed coded data.
One conventional example of a data decoder is shown in FIG. 20, which is disclosed in the Japanese Unexamined Patent Publication No. Hei 09-214351. The device is a Moving Picture Experts Group (MPEG) decoder. After a coded data having multiplexed video and audio media data is input to the decoder, a System Clock Reference (SCR) is demultiplexed at a demultiplexer 34, and then SCR is sent to a system synchronization controller 28. Media data, which is the video data and audio data, is also demultiplexed at demultiplexer 34, and stored in a buffer 22a and a buffer 22b, respectively. A video decoder 32 and an audio decoder 30 decode the coded video and audio data stored in buffers 22a and 22b, and at the same time, demultiplex a video Presentation Time Stamp (PTS) and an audio PTS which specify the presentation time, and transmit the video PTS and audio PTS to system synchronization controller 28.
System synchronization controller 28 monitors and determines the output timing of the decoded data based on the two PTS values and a System Synchronous Clock (SSC) value reproduced from the SCR. The determination result, the time difference in the decoding timing is notified to an audio decoder 30 for the audio data, and to a video decoder 32 for the video data.
System synchronization controller 28 determines the output timing by comparing the SSC value with the PTS added by the offset values. Agreed values indicate that the timing is correct. When the SSC value is larger, the decoding speed is slow, while the smaller SSC value indicates that the decoding speed is fast. The offset value is a fixed value kept by system synchronization controller 28, and can be changed with a dip switch, etc., because the offset value defers depending on the system configuration, and so on.
The offset value can be automatically adjusted in accordance with the determination result. For instance, if the audio decoding speed is determined to be fast consecutively for more than a certain number of times, then the offset value is decreased.
The conventional data decoder is inconvenient because the characteristics of a encoder changes every time when the encoder is changed, and the offset value has to be changed. When the automatic adjustment function of the offset value is used, it takes time to find the correct value.
This invention aims at solving the above-mentioned problems. It aims at realizing correct and prompt media synchronization between video and audio, and minimizing the buffering time before decoding.
A data decoder of the present invention may comprise a demultiplexer for inputting a multiplexed coded data including a first coded data and a second coded data, and a synchronous information for synchronizing the first coded data and the second coded data, and outputting the first coded data, the second coded data, and the synchronous information separately; a first buffer memory for inputting and storing the first coded data demultiplexed by the demultiplexer; a second buffer memory for inputting and storing the second coded data demultiplexed by the demultiplexer; a first decoder for inputting and decoding the first coded data stored in the first buffer memory, and outputting a decoded data as a first decoded data; a second decoder for inputting and decoding the second coded data stored in the second buffer memory, and outputting the decoded data as a second decoded data; and a timing controller for inputting the synchronous information demultiplexed by the demultiplexer, for obtaining a buffering time to store the first coded data in the first buffer memory as a first buffering time and a buffering time to store the second coded data in the second buffer memory as a second buffering time, and for controlling an output time of the first coded data stored in the first buffer memory to the first decoder based on the first buffering time and controlling an output time of the second coded data stored in the second buffer memory into the second decoder based on the second buffering time, so that the first decoded data by the first decoder and the second decoded data by the second decoder may be output synchronously as indicated by the synchronous information.
The demultiplexer may demultiplex a first specified presentation time at which the first decoded data is to be output and a second specified presentation time at which the second decoded data is to be output as the synchronous information, and the timing controller may calculate the first buffering time and the second buffering time in such a manner that a time difference between the first specified presentation time and the second specified presentation time may agree to a time difference between the output time of the first decoded data and the output time of the second decoded data.
The first decoder may output a first timing pulse when the first decoded data in a designated unit has been decoded, and the second decoder may output a second timing pulse when the second decoded data in the designated unit has been decoded, and the timing controller may input the first and the second timing pulses, obtain a first and a second presentable times, respectively, and assign the time difference between the first specified presentation time and the first presentable time as the first buffering time and the time difference between the second specified presentation time and the second presentable time as the second buffering time.
The timing controller may input the timing pulse at a time of completing a first decoding of the first decoded data in the designated unit as the first timing pulse and input the timing pulse at the time of completing the first decoding of the second decoded data in the designated unit as the second timing pulse.
The demultiplexer may demultiplex and output a first identifier for identifying the first decoded data in each designated unit, and demultiplex and output a second identifier for identifying the second decoded data in each designated unit, and the first decoder may output the first identifier and the first timing pulse and the second decoder may output the second identifier and the second timing pulse, and the timing controller may input the first identifier output from the demultiplexer and the first identifier output from the first decoder, may identify the first decoded data, and calculate the first buffering time of the first decoded data to be decoded after an identified first decoded data, and input the second identifier output from the demultiplexer and the second identifier output from the second decoder, identify the second decoded data, and calculate the second buffering time of the second decoded data to be decoded after an identified second decoded data.
The first and second identifiers may be numeric values assigned to the first and second coded data for each designated unit at the time of coding.
The first and second identifiers may be numeric values assigned to the first and second coded data by the demultiplexer for each designated unit.
The timing controller may obtain a presentable time for the first decoded data using a remaining buffer amount management information contained in the first decoded data, and assign the time difference between the first specified presentation time and a first presentable time as the first buffering time.
The timing controller may add a buffering time of the first decoded data indicated as the remaining buffer amount management information at the time when the demultiplexer may demultiplex the first decoded data and a delay time required by the first decoder for a decoding processing of the first decoded data, in order to obtain the presentable time.
The timing controller may subtract a same designated time from the first buffering time and the second buffering time to obtain a new first buffering time and a new second buffering time.
The same designated time may be a time shorter of the first buffering time and the second buffering time.
The first decoder and the second decoder may have frame buffers which store the first and second decoded data in designated units respectively, and then output at a designated timing, and may output a first and a second timing pulses when the first and second decoded data are output from the frame buffers in the designated units respectively, and the timing controller may input the first and the second timing pulses, obtain a first and a second presentable times, and assign the time difference between the first specified presentation time and the first presentable time as a first buffering time, and the time difference between the second specified presentation time and the second presentable time as a second buffering time.
A data decoding method of the present invention may comprise the steps of: inputting a multiplexed coded data including a first coded data and a second coded data and a synchronous information for synchronizing the first coded data and the second coded data and separately outputting the first coded data, the second coded data, and the synchronous information; inputting the first coded data demultiplexed at a demultiplexing step and storing in a first buffer memory; inputting the second coded data demultiplexed at the demultiplexing step and storing in a second buffer memory; inputting and decoding the first coded data stored in the first buffer memory, and outputting a decoded data as a first decoded data; inputting and decoding the second coded data stored in the second buffer memory, and outputting the decoded data as a second decoded data; and inputting the synchronous information demultiplexed by the demultiplexing step, obtaining a buffering time to store the first coded data in the first buffer memory as a first buffering time and a buffering time to store the second coded data in the second buffer memory as a second buffering time, and for controlling an output time of the first coded data stored in the first buffer memory to the first coded data decoding step based on the first buffering time and the second coded data stored in the second buffer memory into the second coded data decoding step based on the second buffering time, so that the first decoded data by the first decoder and the second decoded data by the second decoder are output synchronously as indicated by the synchronous information.